
// TaxiInfo.java

package com.ruoyi.hospital.entity.check;

import com.ruoyi.hospital.entity.TravelChargeVO;

/**
 * 行程明细
 */
@lombok.Data
public class CheckTaxiInfo {
    /**
     * 服务地址
     */
    private String serveAddress;
    /**
     * 预付行程费（往返）
     */
    private Long preAmount;
    /**
     * 实际行程费（往返）
     */
    private Long actualAmount;
    /**
     * 实际去程费
     */
    private Long goAmount;

    /**
     * 实际返程费
     */
    private Long backAmount;

    public void init(TravelChargeVO travelCharge) {
        this.serveAddress = travelCharge.getAddressInfo();
        this.preAmount = travelCharge.getAdvancePrice();
        if (travelCharge.getActualPrice() != null && travelCharge.getBillPrice() != null){
            this.actualAmount = travelCharge.getBillPrice() + travelCharge.getActualPrice();
            this.goAmount = travelCharge.getBillPrice();
            this.backAmount = travelCharge.getActualPrice();
        }else{
            this.actualAmount = travelCharge.getAdvancePrice();
        }

    }
}
